import axios from 'axios'

axios.defaults.baseURL = 'http://www.lovegf.cn:8899/api'
// 获取录播图数据
export const getlunbo = () => {
    return axios.get('/getlunbo').then(res => res.data)
}
// 获取新闻列表
export const getnewslist = () => {
    return axios.get('/getnewslist').then(res => res.data)
}
// 获取新闻内部内容
export const getNewsInfo = params => {
    return axios.get(`/getnew/${params}`).then(res => res.data)
}
// 获取评论
export const getComments = params => {
    return axios.get(`/getcomments/${params.id}?pageindex=${params.pageIndex}`).then(res => res.data)
}
// 发送评论
export const postComments = (params) => {
    return axios.post(`/postcomment/${params.id}`,{content:params.content}).then(res => res.data)
}
// 获取图片
export const getAllCategory = () => {
    return axios.get('/getimgcategory/').then(res => res.data)
}
// 获取商品列表
export const getGoodsList = params => {
    return axios.get(`/getgoods?pageindex=${params}`).then(res => res.data)
}
// 获取商品详情页轮播图
export const getLunbotu = params => {
    return axios.get(`/getthumimages/${params}`).then(res => res.data)
}
// 获取商品参数信息
export const getGoodsInfo = params => {
    return axios.get(`/goods/getinfo/${params}`).then(res => res.data)
}
// 获取商品详情信息
export const getGoodsDesc = params => {
    return axios.get(`/goods/getdesc/${params}`).then(res => res.data)
}
// 获取购物车商品列表
export const getShopList = params => {
    return axios.get(`/goods/getshopcarlist/${params}`).then(res => res.data)
}